<template>
  <div style= "height: 100%">
    <el-container style= "height: 100%">
      <!--侧边栏el-aside--><!--width=  "sideWidth+'px'"-->
      <el-aside
        width= "sideWidth+'px'"
        style= "
          background-color: rgb(238, 241, 246);
          height: 100vh;
          box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
        "
      >
      <!--改造el-menu，可以直接从组件中aside.vue当中引入-->

        <Aside  :isCollapse = "isCollapse"  :logoTextShow = "logoTextShow" /><!--需要传入的值用组件传值传进来-->
      </el-aside>

      <el-container>
        <el-header style= "border-bottom: 1px solid #ccc;">
          <!--头部，从Header文件当中引入-->
          <Header :collapseBtnClass= "collapseBtnClass" :collapse= "collapse" />
        </el-header>
        <!--对话框信息，默认不打开-->
        
        <div style="padding:0px">
        <el-main>
          <router-view /><!--router-view表示当前页面的子路由会在router-view里面展示-->
        </el-main>
        </div>
      </el-container>
    </el-container>
  </div>
  <!--    <h1>{{msg}}</h1>--><!--数据绑定-->
  <!--    <el-button>这是一个测试按钮</el-button>-->
  <!--    <el-button type = "danger">{{msg}}</el-button>-->
  <!--    <img alt= "Vue logo" src= "../assets/logo.png">-->
  <!--    <HelloWorld msg= "Welcome to Your Vue.js App"/>-->
</template>

<script>
// @ is an alias to /src
// import request from "@/utils/request";可以删掉这段话，因为request已经在main.js中全局注册了

import Aside from "@/components/aside.vue"
import Header from "@/components/header.vue"
// import Teacher from "@/views/Teacher.vue"

export default {
  name: "HomeView",
  data() {
    return {
      
      // //模糊分页查询
      // tableData: [], //删除王小虎的假数据，表格数据默认空数组
      // total: 0, //总条数
      // pageNum: 1, //第几页
      // pageSize: 4, //每页几条数据
      // teacherName: "",
      // nickName: "",
      // email: "",
      // createTime:"",
      // updateTime:"",
      // //Dialog对话框
      // dialogFormVisible: false,
      // //多选框
      // form: {},
      // multipleSelection:[],
      // dialogVisible: false,

      collapseBtnClass: "el-icon-s-fold",
      isCollapse: false,
      logoTextShow: true,
      sideWidth: 201,
      teacher:{},
      
    };
  },
  //引入导航栏，花括号表示是一个Object，[]表示数组
  components:{
      Aside,
      Header
  },
//create写在了Teacher.vue里面 
  methods: {
    collapse() {
      /*点击收缩按钮触发，变为收缩状态*/
      /*左侧边栏收缩展开*/
      this.isCollapse = !this.isCollapse;
      if (this.isCollapse) {
        this.sideWidth = 64;
        this.collapseBtnClass = "el-icon-s-unfold";
        this.logoTextShow = false;
      } else {
        this.sideWidth = 200;
        this.collapseBtnClass = "el-icon-s-fold";
        this.logoTextShow = true;
      }
    },
    // getTeacher(){
    //   let teacherName = localStorage.getItem("teacher")?JSON.parse(localStorage.getItem("teacher")).teacherName:""
    //   if(teacherName){
    //     this.request.get("/teacher")
    //     this.teacher = res.data
    //   }
    // }
  }
};
</script>

<style>
/*.el-header {*/
/*  background-color: #b3c0d1;*/
/*  color: #333;*/
/*  line-height: 60px;*/
/*}*/

/*.el-aside {*/
/*  color: #333;*/
/*}*/


</style>


<!--分页暂时不用的代码
                @size-change= "handleSizeChange"
                @current-change= "handleCurrentChange"
                :current-page= "currentPage4"-->